import java.util.Scanner;
class SimpleStudentManager{

    static class Student {
        String name;
        int id;
        int age;

        public Student(String name, int id, int age) {
            this.name = name;
            this.id = id;
            this.age = age;
        }

        void display() {
            System.out.println("学号: " + id + ", 姓名: " + name + ", 年龄: " + age);
        }
    }

    public static void main(String[] args) {
        Student[] students = new Student[100]; // 最多存储100个学生
        int count = 0; // 记录当前学生数量
        Scanner scanner = new Scanner(System.in);

        System.out.println("=== 简易学生信息管理系统 ===");

        while (true) {
            System.out.println("\n1. 添加学生");
            System.out.println("2. 显示所有学生");
            System.out.println("3. 退出");
            System.out.print("请选择(1-3): ");

            int choice = scanner.nextInt();

            switch (choice) {
                case 1:
                    if (count >= 100) {
                        System.out.println("存储已满，无法添加更多学生!");
                        break;
                    }
                    System.out.print("输入学生姓名: ");
                    String name = scanner.next();
                    System.out.print("输入学生学号: ");
                    int id = scanner.nextInt();
                    System.out.print("输入学生年龄: ");
                    int age = scanner.nextInt();

                    students[count] = new Student(name, id, age);
                    count++;
                    System.out.println("添加成功!");
                    break;

                case 2:
                    if (count == 0) {
                        System.out.println("暂无学生信息!");
                    } else {
                        System.out.println("\n=== 学生列表 ===");
                        for (int i = 0; i < count; i++) {
                            students[i].display();
                        }
                    }
                    break;

                case 3:
                    System.out.println("感谢使用，再见!");
                    scanner.close();
                    return;

                default:
                    System.out.println("输入错误，请重新选择!");
            }
        }
    }
}